﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class ThreadDebugger : MonoBehaviour
{

    // Use this for initialization
    void OnEnable()
    {
        DateTime before = DateTime.Now;
        ParallelTask.BeginParallelTask();

        int[] array = new int[49000];

        ParallelTask.DoParallelFor<int>(array, (ele,i) => 
        {
            for (int j = 0; j < 4000; j++)
            {
                Math();
            }
        }, 2);
      
        ParallelTask.EndParallelTask();
        Debug.Log("Done in " + (DateTime.Now - before).TotalSeconds);
    }

    void Math()
    {
        float result = Mathf.Sin(10) + Mathf.Cos(10);

    }
}
